package com.example.goodsprovider.controller;

import com.example.goodsprovider.mapper.UserorderMapper;
import com.myshop.b2b.commonmodule.Userorder;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Set;

/**
 * @author likaiping
 * @createTime 2024/7/3 15:35
 */
@RestController
@AllArgsConstructor
public class OrderController {
    private UserorderMapper userorderMapper;

    @GetMapping("/getAllorder")
    public List<Userorder> getAllorder(@RequestParam(value = "uid")int uid){
        return userorderMapper.getAllorder(uid);
    }

    @GetMapping("/insertSecKillOrder")
    public boolean insertSecKillOrder(@RequestParam("goodsname") String goodsname,
                                     @RequestParam("number")int number,
                                     @RequestParam("price")int price,
                                      @RequestParam("userIds") List<Integer> userIds){
        return userorderMapper.insertSecKillOrder(goodsname,number,price,userIds);
    }
}
